window.onload = main_nav;
function main_nav(){
    var mainNav = document.getElementsByClassName("main_nav");
    var unList = mainNav[0].getElementsByTagName("ul");
    var listA = unList[0].getElementsByTagName("a");
    for(var i=0;i<listA.length;i++){
        listA[i].onclick = function () {
            for(var j=0;j<listA.length;j++){
                listA[j].style.backgroundColor = "#a2c7da";
            }
            this.style.backgroundColor = "#56c3b9";
        }
    }
}